/**
 * 
 */
package com.glodon.paas.account.dao.mysql;

import org.springframework.beans.factory.annotation.Autowired;

import com.glodon.paas.account.dao.ScopeDao;
import com.glodon.paas.account.dao.domain.ScopeEntity;
import com.glodon.paas.account.dao.mapper.ScopeEntityMapper;

/**
 * @author hankl
 *
 */
public class ScopeDaoMysqlImpl implements ScopeDao {

	@Autowired
	ScopeEntityMapper scopeEntityMapper;
	
	@Override
	public String insert(ScopeEntity entity){
		scopeEntityMapper.insert(entity);
		return entity.getScopeId();
	}
	
	@Override 
	public ScopeEntity get(String id){
		ScopeEntity entity = scopeEntityMapper.selectByScopeId(id);
		return entity;
	}
	
	@Override
	public int delete(String id){
		scopeEntityMapper.deleteByScopeId(id);
		return 0;
	}
}
